import { Module } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';

@Module({
  providers: [
    {
      provide: ConfigService,
      useValue: {
        get: (key: string) => {
          // 在实际项目中，应该从环境变量中读取配置
          const config: Record<string, string> = {
            JWT_SECRET: 'adblkjslkdjf154548464654',
            JWT_EXPIRES_IN: '4h',
            DB_HOST: 'localhost',
            DB_PORT: '3306',
            DB_USERNAME: 'root',
            DB_PASSWORD: 'root',
            DB_DATABASE: 'music_website',
            DB_NAME: 'music_website',
            PORT: '3001',
          };
          return config[key];
        },
      },
    },
  ],
  exports: [ConfigService],
})
export class ConfigModule {}
